package com.becca.cake.model.order;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import org.springframework.format.annotation.DateTimeFormat;

/**
 * 商品明细实体
 * @copyright  尊星(上海)信息科技有限公司
 * @author hejinguo
 * @date 2016年4月10日 上午3:29:00
 */
public class OrderDetailsModel implements Serializable {
    /**  */
    private static final long serialVersionUID   = 8792657070185337891L;

    /**商品类型(0:商品 )*/
    public static final Byte  GOODS_TYPE_DEFALUT = 0;

    /**商品类型(1:配件 )*/
    public static final Byte  GOODS_TYPE_FIXINGS = 1;

    private Integer           id;
    /**订单编号*/
    private Integer           orderId;
    /**商品ID*/
    private Integer           goodId;
    /**商品编码*/
    private String            goodsCode;
    /**商品名称*/
    private String            goodsName;
    /**商品尺寸*/
    private String            goodsSize;
    /**商品重量*/
    private String            goodsWeight;
    /**商品单价*/
    private Double            goodsPrice;
    /**商品规格编码*/
    private String            goodsStandardCode;
    /**商品数量*/
    private Integer           goodsNumber;
    /**商品单位*/
    private String            goodsUnits;
    /**商品类型(0:商品 1:配件)*/
    private Byte              goodsType;
    /**商品属性(选择项以json格式保存)*/
    private String            goodsAttrs;
    /**小计*/
    private Double            subTotal;
    /**创建时间*/
    private Date              createdDate;
    /**创建人*/
    private String            createdName;
    /**修改时间*/
    private Date              updatedDate;
    /**修改人*/
    private String            updatedName;
    /************************************************************/
    /**商品副标题*/
    private String            goodsSubName;
    /**商品展示图*/
    private String            goodsPic;

    /**订单编号*/
    private String            orderCode;
    /**商品类型名称(0:商品 1:配件)*/
    private String            goodsTypeName;
    /**收货人*/
    private String            consignee;
    /**收货人电话*/
    private String            consignPhone;
    /**收货人地址*/
    private String            consignAddress;
   /**支付方式(0:微信 1：支付宝)*/
    private Byte                    payType;
   /**配送日期*/
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date                    deliveryDate;
    /**配送时间段*/
    private String                  deliveryTimes;
    /**实际金额小计*/
    private Double            		paySubTotal;

    /**
     * 热敏打印订单配件信息
     * @param listOrderDetails
     */
    public static String transGoodsFixingName(List<OrderDetailsModel> listOrderDetails) {
        String goodsFixingName = "";
        if (listOrderDetails != null && listOrderDetails.size() > 0) {
            for (OrderDetailsModel detailsModel : listOrderDetails) {
                goodsFixingName += detailsModel.getGoodsName() + "("
                                   + detailsModel.getGoodsNumber() + "*"
                                   + detailsModel.getGoodsPrice() + ");";
            }
        }
        return goodsFixingName;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getGoodId() {
        return goodId;
    }

    public void setGoodId(Integer goodId) {
        this.goodId = goodId;
    }

    public String getGoodsCode() {
        return goodsCode;
    }

    public void setGoodsCode(String goodsCode) {
        this.goodsCode = goodsCode;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public String getGoodsStandardCode() {
        return goodsStandardCode;
    }

    public void setGoodsStandardCode(String goodsStandardCode) {
        this.goodsStandardCode = goodsStandardCode;
    }

    public String getGoodsSize() {
        return goodsSize;
    }

    public void setGoodsSize(String goodsSize) {
        this.goodsSize = goodsSize;
    }

    public String getGoodsUnits() {
        return goodsUnits;
    }

    public void setGoodsUnits(String goodsUnits) {
        this.goodsUnits = goodsUnits;
    }

    public String getGoodsWeight() {
        return goodsWeight;
    }

    public void setGoodsWeight(String goodsWeight) {
        this.goodsWeight = goodsWeight;
    }

    public Double getGoodsPrice() {
        return goodsPrice;
    }

    public void setGoodsPrice(Double goodsPrice) {
        this.goodsPrice = goodsPrice;
    }

    public Integer getGoodsNumber() {
        return goodsNumber;
    }

    public void setGoodsNumber(Integer goodsNumber) {
        this.goodsNumber = goodsNumber;
    }

    public String getGoodsAttrs() {
        return goodsAttrs;
    }

    public void setGoodsAttrs(String goodsAttrs) {
        this.goodsAttrs = goodsAttrs;
    }

    public Double getSubTotal() {
        return subTotal;
    }

    public void setSubTotal(Double subTotal) {
        this.subTotal = subTotal;
    }

    public Date getCreatedDate() {
        return createdDate;
    }

    public void setCreatedDate(Date createdDate) {
        this.createdDate = createdDate;
    }

    public String getCreatedName() {
        return createdName;
    }

    public void setCreatedName(String createdName) {
        this.createdName = createdName;
    }

    public Date getUpdatedDate() {
        return updatedDate;
    }

    public void setUpdatedDate(Date updatedDate) {
        this.updatedDate = updatedDate;
    }

    public String getUpdatedName() {
        return updatedName;
    }

    public void setUpdatedName(String updatedName) {
        this.updatedName = updatedName;
    }

    public String getGoodsSubName() {
        return goodsSubName;
    }

    public void setGoodsSubName(String goodsSubName) {
        this.goodsSubName = goodsSubName;
    }

    public String getGoodsPic() {
        return goodsPic;
    }

    public void setGoodsPic(String goodsPic) {
        this.goodsPic = goodsPic;
    }

    public Byte getGoodsType() {
        return goodsType;
    }

    public void setGoodsType(Byte goodsType) {
        this.goodsType = goodsType;
    }

    public Integer getOrderId() {
        return orderId;
    }

    public void setOrderId(Integer orderId) {
        this.orderId = orderId;
    }

    public String getOrderCode() {
        return orderCode;
    }

    public void setOrderCode(String orderCode) {
        this.orderCode = orderCode;
    }

    public String getGoodsTypeName() {
        return goodsTypeName;
    }

    public void setGoodsTypeName(String goodsTypeName) {
        this.goodsTypeName = goodsTypeName;
    }

    public String getConsignee() {
        return consignee;
    }

    public void setConsignee(String consignee) {
        this.consignee = consignee;
    }

    public String getConsignPhone() {
        return consignPhone;
    }

    public void setConsignPhone(String consignPhone) {
        this.consignPhone = consignPhone;
    }

    public String getConsignAddress() {
        return consignAddress;
    }

    public void setConsignAddress(String consignAddress) {
        this.consignAddress = consignAddress;
    }

    public Byte getPayType() {
        return payType;
    }

    public void setPayType(Byte payType) {
        this.payType = payType;
    }

    public Date getDeliveryDate() {
        return deliveryDate;
    }

    public void setDeliveryDate(Date deliveryDate) {
        this.deliveryDate = deliveryDate;
    }

    public String getDeliveryTimes() {
        return deliveryTimes;
    }

    public void setDeliveryTimes(String deliveryTimes) {
        this.deliveryTimes = deliveryTimes;
    }
    public Double getPaySubTotal()
	{
		return paySubTotal;
	}

	public void setPaySubTotal(Double paySubTotal)
	{
		this.paySubTotal = paySubTotal;
	}

	@Override
    public String toString() {
        return "OrderDetailsDO [id=" + id + ", goodId=" + goodId + ", goodsCode=" + goodsCode
               + ", goodsName=" + goodsName + ", goodsSize=" + goodsSize + ", goodsWeight="
               + goodsWeight + ", goodsPrice=" + goodsPrice + ", goodsNumber=" + goodsNumber
               + ", goodsAttrs=" + goodsAttrs + ", subTotal=" + subTotal + ", createdDate="
               + createdDate + ", createdName=" + createdName + ", updatedDate=" + updatedDate
               + ", updatedName=" + updatedName + "]";
    }

}
